<template>
  <div class="activities-container">
    <h1>公开活动列表</h1>
    <div class="activities-list">
      <div v-for="activity in activities" :key="activity.id" class="activity-card">
        <h2>{{ activity.title }}</h2>
        <p>日期：{{ activity.date }}</p>
        <router-link :to="`/public-activities/${activity.id}`" class="detail-button">
          查看详情
        </router-link>
      </div>
    </div>
  </div>
</template>

<script>
import activities from '@/data/activities.js';

export default {
  data() {
    return {
      activities
    };
  }
};
</script>

<style scoped>
.activities-container {
  max-width: 1000px;
  margin: 0 auto;
  padding: 2em;
}

.activities-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
  gap: 1.5em;
}

.activity-card {
  background-color: white;
  border-radius: 8px;
  padding: 1.5em;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
  transition: transform 0.2s;
}

.activity-card:hover {
  transform: translateY(-5px);
}

.detail-button {
  display: inline-block;
  margin-top: 1em;
  padding: 0.5em 1em;
  background-color: #3498db;
  color: white;
  text-decoration: none;
  border-radius: 4px;
}

.detail-button:hover {
  background-color: #2980b9;
}
</style>